package com.gateway.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 测试控制器
 */
@RestController
@RequestMapping("/test")
public class TestController {

    /**
     * 测试接口
     */
    @GetMapping("/gateway")
    public Map<String, Object> testGateway() {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 200);
        result.put("message", "API网关测试成功");
        result.put("timestamp", System.currentTimeMillis());
        return result;
    }
    
    /**
     * 健康检查接口
     */
    @GetMapping("/health")
    public Map<String, Object> health() {
        Map<String, Object> result = new HashMap<>();
        result.put("status", "UP");
        result.put("message", "API网关正常运行");
        result.put("timestamp", System.currentTimeMillis());
        return result;
    }
} 